home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_oth / tm480 / tmmanual.exe / PRINTSCR.TSK < prev    next >
Text File  |  1991-09-10  |  11KB  |  425 lines

  1. ; Title   : PRINTSCR.TSK                Last Updated : September 5, 1991
  2. ; Author  : Steve Johnson - FmP.        Version      : 1.20
  3. ; Purpose : Selective On-line SCR manual print facility
  4. ; Notes   : Can suppress blank lines.
  5. ;         : Requires IBM Graphics printer emulation to print.
  6. ;         : Form names were captured from SCR output into a file.
  7. ;         : checks for sufficient disc space at start and during run.  
  8. ;         : popups are used so as to obviate need to switch forms files.
  9. ;         : during run.
  10. ; version 1.20 
  11. ;         : No longer uses popups
  12. ;         : Can now strip out 'non-printable' characters
  13. ; version 1.10 
  14. ;         : Optional use of form-feeds 
  15.  
  16. define pages,1
  17.  
  18. hexvar beep,07
  19. hexvar crlf,0d0a
  20. hexvar esc,1b
  21. hexvar line_23,c8cd
  22. hexvar vbar,ba
  23.  
  24. int count
  25. int xcount
  26. int line
  27. int lines_this_page
  28. int saftey
  29. int toapage
  30.  
  31. logical last_was_spaces
  32. logical form_feeds
  33. logical next_menu
  34. logical partial
  35. logical proceed
  36. logical quit
  37. logical skip
  38. logical suppress
  39. logical no_translate
  40.  
  41. var quote,1,'"'
  42. var menu_formnames,14,occurs 10,
  43. 'MAIN          '
  44. 'M0            '
  45. 'M1            '
  46. 'M2            '
  47. 'M3            '
  48. 'M4            '
  49. 'M5            '
  50.  
  51. var formindex,14,occurs70,
  52. 'USER_INTERFACESYMBOLS       MAIN          FLAGS         OPTIONS       '
  53. 'INVOCATION    FILENAMES     IN-LINE       COLOURS       BACKGROUND    '
  54. 'FOREGROUND    GRAPHICS      FLASHING      INSERTING     M0            '
  55. 'ALPHA         ACCEPTFK      BANNER        BBMENU        BBIMENU       '
  56. 'BORDER        BRIGHT        M1            COLOUR        DATE          '
  57. 'DIM           DEFAULTS      DF            DOUBLE        DRAW          '
  58. 'END           M2            FILENAME      GOFF          GON           '
  59. 'HEADING       LIST          LOGICAL       MAP           M3            '
  60. 'MENU          NF            NUMBER        OVERLAY       PATH          '
  61. 'PRINTER       M4            RANGE         REPEAT        SINGLE        '
  62. 'SOFT          SPACES        STRING        TIME          M5            '
  63. 'TRANSLATE     USERLINE      VIDEO         WINDOW        '
  64.  
  65. var act_space,12
  66. var min_space,12,'      120000'    ;disc space warning limit at start
  67. var work_space,12,'        2500';disc space warning limit 2500 bytes
  68.  
  69. var char,1
  70. var formname,14
  71. var last_line,80
  72. var lines_per_page,2
  73. var name,8,'PRINTSCR'
  74. var null,1
  75. var s_line,90
  76. var screen,80,occurs24
  77. var space_line,80
  78. var spaces_78,78
  79. var translations,1,occurs 5
  80. hexvar unprin_table,18191b1a11
  81. var unprintable,1,occurs 5
  82.  
  83. vconst attn,79
  84. vconst brite,41
  85. vconst cls,11  ;Clear screen
  86.  
  87. end
  88. enable ctrl_c
  89. clear spaces_78
  90. forms logon.ovr
  91. lookfor printscr.ovr
  92. if not found
  93.   insert name name
  94.   put "NO_FORMS"
  95.   stop
  96. fi
  97. move unprin_table to unprintable
  98. forms printscr.ovr
  99. dspace
  100. move display to act_space
  101. if act_space < min_space
  102.   put space_warn
  103.   get proceed
  104.   if not proceed
  105.     stop
  106.   fi
  107. fi
  108. put manprint
  109. if anyfk
  110.   stop
  111. fi
  112. get suppress lines_per_page form_feeds
  113. put graph
  114. if funkey = 10
  115.   stop
  116. fi 
  117. move fk2 to no_translate
  118. if not fk2
  119.   until xcount = 6
  120.     get entry xcount of translations
  121.   fi xcount
  122.   clear xcount
  123. fi
  124. lookfor scrman.ovr
  125. if not found
  126.   put 'NO_TMMAN'
  127.   stop
  128. fi
  129. move lines_per_page to saftey
  130. move lines_per_page to toapage
  131. subtract 24 from saftey
  132. forms scrman.ovr
  133. behave 3 'SCRMAN.MAN'
  134. until count = 75
  135.   move entry count of formindex to formname
  136.   trim formname
  137.   inkey 
  138.   if key 
  139.     screen 1
  140.     forms printscr.ovr
  141.     screen 0
  142.     put break-in
  143.     get char
  144.     upper char
  145.     screen 1
  146.     forms scrman.ovr
  147.     screen 0
  148.     if char = 'Y'
  149.       move true to quit 
  150.       move true to partial 
  151.     fi
  152.   fi
  153.   if formname = null or quit
  154.     behave 0
  155.     display cls
  156.     cursor 12 25 'Your manual is called SCRMAN.MAN'
  157.     cursor 13 25 'View with LIST? Answer Y or N '
  158.     inkey char
  159.     upper char 
  160.     if char = 'Y'
  161.       move true to hide
  162.       run 'LIST SCRMAN.MAN'
  163.     fi
  164.     display cls
  165.     cursor 12 15 'Your manual is ready for printing in SCRMAN.MAN'
  166.     if partial   
  167.       cursor 13 15 'Length ' pages ' pages (Extract only)'
  168.     else
  169.       cursor 13 15 'Length ' pages ' pages (Contains full listing)'
  170.     fi
  171.     stop
  172.   fi
  173.   clear skip
  174.   find menu_formnames sw formname 
  175.   if found
  176.     move 8000h to bbmask
  177.     put formname nodata noclear
  178.     userline brite attn 'Press <return> (or wait 5 seconds) to print this section, <esc> to skip'
  179.     display beep
  180.     wait 5
  181.     clear next_menu
  182.     if keyval = esc and key
  183.       move true to partial
  184.       increment count
  185.       until next_menu or formname = null
  186.         move entry count of formindex to formname
  187.         trim formname
  188.         if formname ne null
  189.           find menu_formnames sw formname 
  190.         fi
  191.         move found to next_menu
  192.       fi count
  193.       decrement count count
  194.       move true to skip
  195.     else  
  196.       if lines_this_page ne 0 
  197.         increment pages
  198.         if form_feeds
  199.           data ^l crlf
  200.         else
  201.           until lines_this_page >= toapage
  202.             data crlf
  203.           fi lines_this_page
  204.         fi
  205.         clear lines_this_page
  206.       fi
  207.       userline brite attn 'Printing ' formname '... Press any key to break-in' 
  208.     fi
  209.   else
  210.     move 1 to timer
  211.     put formname wait 0 noclear
  212.     userline brite attn 'Printing ' formname '... Press any key to break-in' 
  213.   fi
  214.   if not skip
  215.     clear line
  216.     until line = 24
  217.       clear s_line
  218.       scanvid line giving s_line 
  219.       move s_line to entry line of screen
  220.     fi line
  221.     clear line last_was_spaces
  222.     until line = 24
  223.       move entry line of screen to s_line
  224.       if s_line ct '^'
  225.         replace all '^' of s_line with '^^'
  226.       fi
  227.       if not no_translate
  228.         clear xcount
  229.         until xcount = 5
  230.           if s_line ct entry xcount of unprintable
  231.             replace all entry xcount of unprintable of s_line with entry xcount of translations
  232.           fi
  233.         fi xcount
  234.       fi
  235.       if suppress
  236.         if line = 23
  237.           data s_line crlf
  238.           increment lines_this_page
  239.         else
  240.           if s_line ct spaces_78
  241.             move true to last_was_spaces
  242.           else
  243.             if last_was_spaces and s_line sw vbar
  244.               combine vbar 78 vbar into space_line
  245.               data space_line crlf
  246.               increment lines_this_page
  247.             fi
  248.             data s_line crlf 
  249.             increment lines_this_page
  250.             clear last_was_spaces
  251.           fi
  252.         fi
  253.       else
  254.         data s_line crlf 
  255.         increment lines_this_page
  256.       fi
  257.     fi line
  258.     if lines_this_page > saftey
  259.       increment pages
  260.       if form_feeds
  261.         data ^l crlf
  262.       else
  263.         until lines_this_page >= toapage
  264.           data crlf
  265.         fi lines_this_page
  266.       fi
  267.       clear lines_this_page
  268.     fi
  269.     dspace
  270.     move display to act_space
  271.     if act_space < work_space
  272.       screen 1
  273.       forms printscr.ovr
  274.       screen 0
  275.       put no-space
  276.       forms scrman.ovr
  277.       move true to quit
  278.       move true to partial
  279.     fi
  280.   fi
  281. fi count
  282.  
  283. endtask
  284.  
  285.  
  286. @video
  287. @nf manprint
  288. @acceptfk f10
  289. @dim
  290. @logical
  291. @num min40,max99
  292. @logical
  293. @head left,PRINTSCR.TSK
  294. @head right,'Taskmaster (c) FmP 1991'
  295. @head centre,'Taskmaster Manual Extraction'
  296. @colour page,cyan,blue
  297. @banner
  298. @border
  299.  
  300.      This  task takes forms from SCRMAN.OVR and displays them on the  screen 
  301.      then  reads  the  screen and writes the contents  to  SCRMAN.MAN.   The 
  302.      output file is ~100k in size.  
  303.  
  304.      In order to save paper consecutive blank lines found in the screens can 
  305.      be discarded: 
  306.      Do you wish to discard duplicate blank lines? [Y]
  307.  
  308.      The task paginates the output:
  309.      How many lines do you want on each page? [66] 40-99
  310.      Use form-feed characters to eject pages? [N]
  311.  
  312.      The pagination is not very sophisticated and may throw pages in  places 
  313.      where  it doesn't need to.  The task gives you the chance to  view  the 
  314.      output file with LIST which can also be used for printing.   
  315.  
  316. @translate
  317. @MAP #,9C
  318.      Please note that the documentation produced is not as comprehensive  or 
  319.      as readable as that in the printed manual which costs #20.
  320. @bright
  321. @use 'Press F10 to abandon'
  322. @end
  323. @nf graph
  324. @acceptfk esc,f2
  325. @head centre,'Graphics characters'
  326. @colour page,cyan,blue
  327. @banner
  328. @border
  329. @str min1
  330. @str min1
  331. @str min1
  332. @str min1
  333. @str min1
  334.  
  335.      The printout will contain some characters that your printer may not  be 
  336.      able to easily print (notably     and ) for this reason you may 
  337.      wish  to use other characters to represent these.  Please  specify  the 
  338.      characters to be used (else press F2 to leave them as they are).
  339.  
  340.      for  use [U] 
  341.      for  use [D] 
  342.      for  use [L] 
  343.      for  use [R] 
  344.      for  use [<] 
  345.  
  346.      Press  to translate as per the entries above;
  347.      Press f2 to prevent translation;
  348.      Press f10 to quit PRINTSCR 
  349.  
  350.      Please  note  that the printer will need to be able to  print  the  IBM  
  351.      graphics character set to print the file successfully. 
  352. @end
  353. @nf no_tmman
  354. @colour char,white,red
  355. @dim
  356. @win line4,column20,depth16,width42
  357. @out white
  358.  PRINTSCR-Error:
  359.  PRINTSCR  requires access to  the  forms 
  360.  file for the on-line manual.  This  file 
  361.  is   called  SCRMAN.OVR.   It   is   not 
  362.  currently   available.   The   file   is 
  363.  normally    created    either     during 
  364.  installation  or via  OVERVIEW.TSK  (you 
  365.  can  of course also create  it  manually 
  366.  with SCR).  
  367.  
  368.  To create the file from OVERVIEW  select 
  369.  SCRMAN  from the main menu,   this  will 
  370.  create   the   file   and   enter    the 
  371.  application.  You may then exit and  re-
  372.  run PRINTSCR.
  373. @end
  374. @nf break-in
  375. @bright
  376. @colour char,white,red
  377. @logical
  378. @window line10,column15,depth6,width21
  379. @drop
  380. @out cyan
  381.  PRINTSCR
  382.  Break-in detected.
  383.  Abandon processing?
  384.  [N] enter Y or N 
  385.  then press  
  386. @end
  387. @nf no-space
  388. @bright
  389. @colour char,white,red
  390. @window line10,column15,depth10,width21
  391. @drop
  392. @out cyan
  393.  PRINTSCR
  394.  I need more space. 
  395.  Unable to  proceed.
  396.  The amount of  free 
  397.  space  is now  less 
  398.  than  2500   bytes. 
  399.  Please  make   more 
  400.  space  and  re-run. 
  401.  Press any key...
  402. @col char,cyan,blue
  403. @end
  404. @nf space_warn
  405. @head centre,'Free Space'
  406. @log
  407. @colour page,cyan,blue
  408. @banner
  409. @border
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.              This task creates an output file of upto 120k in size.
  418.  
  419.                   Your logged drive has less space than this.  
  420.  
  421.                           Do you wish to proceed? [N] 
  422. @end
  423. @eof
  424. 
  425.